<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*SELECT id, agent_name, Operation_Date, transfer_code, Order_Status1, from_currency, to_currency, transaction_amount, amount_received,
	sender_reference, exchange_rate, Comments   FROM km_msb_form_inward k WHERE transfer_code="PCT" LIMIT 0,1000
	---payments from perfect money
	*/
class Kashmart_model extends CI_Model
{
	protected $db4;
	public $tbl_incoming = 'km_msb_form_inward';
	public $tbl_all = 'km_msb_form';
	
	function __construct(){
		parent::__construct();
		$this->db4 = $this->load->database('kashmart', TRUE, TRUE);
	}
	
	function getAllPayments(){
		$this->db4->select('*');
		$this->db4->from($this->tbl_incoming);
		$query = $this->db4->get();
		$res = $query->result_array();
		//print_r($res);
		return $res;
	}
	
	function getPayment($pID) {
		if($pID){
			$this->db4->select('*');
			$this->db4->like('Comments', $pID);
			$cond = array('Transfer_Code' => 'PCT',
							'Order_Status1' => '1:Paid');
			$q = $this->db4->get_where($this->tbl_incoming, $cond);
			$result = $q->row_array();
			//print_r($result);
			return $result;
		}
		else{
			return false;
		}
	}
}

?>